var table;
layui.use('table',function(){
    table=layui.table;

    sousuo();
    function sousuo(){
        var name=$("#name").val();
        var course=$("#course").val();
        var price=$("#price").val();
        $.ajax({
            url:"/Teacher/selProductRizhi",
            type:"get",
            dataType:"json",
            data:{"name":name,"course":course,"price":price},
            success:function(data){
                getTable(data.obj);
            }
        })
    }
    function getTable(data) {
        table.render({
            elem: "#table_id",
            title: "表格",
            limit: 10,
            page: true,
            data:data,
            cols: [[
                {type: 'checkbox', fixed: 'left'},
                {field: 'product_code', title: '编号', fixed: 'left', width: 120},
                {field: 'product_name', title: '课程名称', fixed: 'left', width: 120},
                {field: 'course_price', title: '销售价格', width: 120},
                {field: 'course_nprice', title: '促销价格', width: 120},
                {field: 'course_status', title: '上下架', width: 120},
                {field: 'course_cstatus', title: '审核状态', width: 100},
                {field: '', title: '操作', width: 180, templet: function (d) {
                        return "<span>查看</span>"+
                            "<span>审核</span>";
                    }
                }
            ]]
        });
    }
});